package com.gxgeek.order.vo;

/**
 * Created by Administrator on 2017/7/11.
 */
public class ResultVOUtil {
    public  static <T> ResultVO<T> success(T data) {
        ResultVO<T> resultVO = new ResultVO<T>();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(data);
        return resultVO;
    }
    public  static <T> ResultVO<T> success() {
        return success(null);
    }

    public  static <T> ResultVO<T> error() {
        ResultVO<T> resultVO = new ResultVO<T>();
        resultVO.setCode(500);
        resultVO.setMsg("失败");
        return resultVO;
    }
    public  static <T> ResultVO<T> error(String msg,Integer code) {
        ResultVO<T> resultVO = new ResultVO<T>();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
